

package ${sdk_package};

import org.budo.dubbo.http.client.android.RequestContext;

public class ${sdk_type} extends RequestContext {
<#list interfaces?sort_by("name") as interface>

    public ${interface.name}Delegate ${interface.name}() {
        return (${interface.name}Delegate) new ${interface.name}Delegate().withRequestContext(this);
    }
</#list>
}

<#list interfaces?sort_by("name") as interface>



package ${sdk_package};

import org.budo.dubbo.http.client.android.AbstractInterfaceDelegate;
import org.budo.dubbo.http.client.android.Deferred;

public class ${interface.name}Delegate extends AbstractInterfaceDelegate{
<#list interface.methods?sort_by("name") as method>

    public Deferred ${method.name}(<@compress single_line=true>
    <#list method.parameterTypes as parameterType>
        ${parameterType.canonicalName} ${method.parameterNames[parameterType_index]} <#if parameterType_index lt (method.parameterTypes?size-1)>,</#if>
    </#list>
</@compress>) {
        return super.invokeMethod("${interface.name}", "${method.name}", ${method.returnType.canonicalName}.class,new Object[]{<@compress single_line=true>
    <#list method.parameterTypes as parameterType>
        ${method.parameterNames[parameterType_index]} <#if parameterType_index lt (method.parameterTypes?size-1)>,</#if>
    </#list>
</@compress>});
    }
</#list>
}
</#list>